home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c++,comp.lang.c
- Subject: Re: Performance: C vs. C++
- Date: 27 Feb 1996 06:39:27 -0600
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4guu1v$ie1@solutions.solon.com>
- References: <30F6BAAC.12B5@iastate.edu> <4frur0$73t@adam.telalink.net> <4fvr7k$a3l@stc06.ctd.ornl.gov> <4gqdo6INNsqe@keats.ugrad.cs.ubc.ca>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <4gqdo6INNsqe@keats.ugrad.cs.ubc.ca>,
- Kazimir Kylheku <c2a192@ugrad.cs.ubc.ca> wrote:
- >Boy, with all this obfuscation, you can almost forget that a pointer is just a
- >simple machine address!
-
- No, it's a machine address or similar tag along with a knowledge of what kind
- of thing it points to. Implementations exist where the conversion from a
- char * to a long * is a right-shift by 2. Although it's not complete, I
- have a draft for an implementation where
- main() {
- int i, *ip = &i;
- }
- leaves ip looking something like "pint, 0".
-
- (0 is not the null pointer internally in this implementation; it's used for
- the first object of a type.)
- (i is internally marked as being an int as well, so &i looks like "pint, 0",
- and the assignment is legal. Assigning from most other pointer types without
- the required cast would generate a run-time fault. ;))
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-